home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v10n06.arc
/
MACDOC.WWD
< prev
next >
Wrap
Text File
|
1991-03-06
|
4KB
|
111 lines
«MDNM»Sub MAIN
REM -- This macro retrieves all global macros, all macros
REM -- in the current template, or both, enters them in
REM -- a document, and formats them in preparation for
REM -- printing.
REM -- Must start with only one Word document open
REM -- using the template with the macros you want to print,
REM -- First define a dialog box to ask whether to print
REM -- template macros, global macros, or both
Begin Dialog UserDialog 284, 134
Text 10, 8, 175, 13, "Copy macros for Printing"
CheckBox 30, 30, 200, 15, "&Template macros", .TP
CheckBox 30, 53, 160, 15, "&Global macros", .GBL
OKButton 184, 77, 88, 21
CancelButton 184, 101, 88, 21
End Dialog
Dim Dlg As UserDialog
REM -- Set default to print template macros only
dlg.TP = 1
dlg.GBL = 0
GetCurValues Dlg
On Error Goto Bailout
REM -- Call up the dialog box defined above.
Dialog Dlg
On Error Goto 0
REM -- Test responses to the dialog box choices.
If dlg.TP = 1 And dlg.GBL <> 1 Then
Goto GetMacros1
ElseIf dlg.TP <> 1 And dlg.GBL = 1 Then
Goto GetMacros0
ElseIf dlg.TP = 0 And dlg.GBL = 0 Then
Goto Bailout
End If
REM -- If dialog box was set to print both template and global
REM -- macros, continue here. Begin loop to print template
REM -- macros first, global macros second
For Cntxt = 1 To 0 Step - 1
Goto Doit
REM -- If dialog box was set to print template macros only,
REM -- continue here. Set the variable Cntxt to print
REM -- template macros only.
GetMacros1: Let Cntxt = 1
Goto Doit
REM -- If dialog box was set to print global macros only,
REM -- continue here. Set the variable Cntxt to print
REM -- global macros only.
GetMacros0: Let Cntxt = 0
REM -- Now let's get the macros, and copy them to the document
Doit: Dim DialogRecord As MacroEdit
For MacroToGet = 1 To CountMacros(Cntxt)
GetCurValues DialogRecord
REM -- test to see if the current macro is this
REM -- (self-referential) macro if not, continue.
If MacroName$(MacroToGet, Cntxt) <> "MacroPrintAll" Then
MacroEdit .Name = MacroName$(MacroToGet, Cntxt),
.Context = Cntxt
EditSelectAll
EditCopy
DocClose(2)
Insert
"*******************************************************"
InsertPara
Insert MacroName$(MacroToGet, Cntxt)
If Cntxt = 1 Then
Insert " (Template Macro)"
Else
Insert " (Global Macro)"
End If
InsertPara
Insert
"****************************************************** "
ChangeFontAndBold
EditPaste
InsertPara
REM -- If the current macro is this (self-referential) macro,
REM -- do not try copying it from the macro window to
REM -- the document window. Instead, insert this message:
Else
Insert
"*******************************************************"
InsertPara
Insert "MacroPrintAll Skipped. "
InsertPara
Insert
"*******************************************************"
ChangeFontAndBold
End If
Next MacroToGet
If dlg.TP = 0 Or dlg.GBL = 0 Then
Goto Bailout
End If
Next Cntxt
Bailout: End Sub
Sub ChangeFontAndBold
REM -- This subroutine formats the text after copying
REM -- it to the document window
InsertPara
CharLeft 1
StartOfLine 1
LineUp 2, 1
FormatCharacter .Font = "Tms Rmn", .Points = "12", .Color = 0, .Bold =
1, .Italic = 0, \
.SmallCaps = 0, .Hidden = 0, .Underline = 0, .WordUnderline = 0, \
.DoubleUnderline = 0, .Position = "0pt", .Spacing = "0pt"
CharRight 2
InsertPara
InsertPara
End Sub